#GLOB_RECURSE可向下查找嵌套目录，GLOB只能查找下一级目录
#CONFIGURE_DEPENDS自动检测目录是否更新,如果目录有新文件了，CMake 会自动帮你重新运行 cmake -B build 更新 myvar 变量。
file(GLOB_RECURSE srcs CONFIGURE_DEPENDS libtest/*.cpp)
file(GLOB_RECURSE srcs_h CONFIGURE_DEPENDS libtest/*.h)
add_library(test SHARED ${srcs})

SET_TARGET_PROPERTIES(test PROPERTIES  OUTPUT_NAME "test")
SET_TARGET_PROPERTIES(test PROPERTIES CLEAN_DIRECT_OUTPUT 1)

# 文件放到该目录下
INSTALL(FILES ${srcs_h} DESTINATION /usr/local/Ascend/thirdpart/include/test)

INSTALL(TARGETS test LIBRARY DESTINATION /usr/local/Ascend/thirdpart/lib)